﻿
/*----------------------------------------------------------------//
// 文件名：MoTfiles.cs
// 文件功能描述：实体 MoTfiles.
// 
// 创建标识：2009-05-05
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTfiles
using System;
using System.Data;
namespace DocSrv.Model
{
	/// <summary>
	/// 业务实体MoTfiles
	/// </summary>
	public partial class MoTfiles:ICloneable
	{
		#region 表Tfiles的字段
		private string fileId;
		private long fileLength;
		private string fileUrl;
		private string fileName;
		private DateTime fileCreateTime;
		#endregion
		
		#region 构造函数
		public MoTfiles()
		{
			    fileCreateTime=new DateTime(1900,1,1);  	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTfiles(MoTfiles item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTfiles(string fileId,long fileLength,string fileUrl,string fileName,DateTime fileCreateTime)
		{
		this.fileId=fileId;
		this.fileLength=fileLength;
		this.fileUrl=fileUrl;
		this.fileName=fileName;
		this.fileCreateTime=fileCreateTime;
		}
		#endregion
		
		#region 表Tfiles的字段属性
		/// <summary>
		/// FILE_ID
		/// </summary>
		public string FileId
		{
			get {return fileId;}
			set {fileId=value;}
		}
		/// <summary>
		/// FILE_LENGTH
		/// </summary>
		public long FileLength
		{
			get {return fileLength;}
			set {fileLength=value;}
		}
		/// <summary>
		/// FILE_URL
		/// </summary>
		public string FileUrl
		{
			get {return fileUrl;}
			set {fileUrl=value;}
		}
		/// <summary>
		///不含目录，包括扩展名
		/// </summary>
		public string FileName
		{
			get {return fileName;}
			set {fileName=value;}
		}
		/// <summary>
		/// FILE_CREATE_TIME
		/// </summary>
		public DateTime FileCreateTime
		{
			get {return fileCreateTime;}
			set {fileCreateTime=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTfiles CopyTo(MoTfiles item)
        {
		    item.fileId=this.fileId;
		    item.fileLength=this.fileLength;
		    item.fileUrl=this.fileUrl;
		    item.fileName=this.fileName;
		    item.fileCreateTime=this.fileCreateTime;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTfiles mo=new MoTfiles();
		    mo.FileId=this.FileId;
		    mo.FileLength=this.FileLength;
		    mo.FileUrl=this.FileUrl;
		    mo.FileName=this.FileName;
		    mo.FileCreateTime=this.FileCreateTime;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoTfiles NewTfiles = obj as MoTfiles;
                if (NewTfiles == null)
                {
                    return false;
                }
                else
                {
				if (NewTfiles.FileId==this.FileId && NewTfiles.FileLength==this.FileLength && NewTfiles.FileUrl==this.FileUrl && NewTfiles.FileName==this.FileName && NewTfiles.FileCreateTime==this.FileCreateTime)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"FileId={0}/FileLength={1}/FileUrl={2}/FileName={3}/FileCreateTime={4}",fileId,fileLength,fileUrl,fileName,fileCreateTime);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["File_ID"]!=null && row["File_ID"]!=DBNull.Value)
			{
			    this.FileId = (string)row["File_ID"];
			}
			else
			{
				this.FileId =string.Empty;
			}
		    if(row["File_Length"]!=null && row["File_Length"]!=DBNull.Value)
			{
			    this.FileLength = (long)row["File_Length"];
			}
			else
			{
				this.FileLength =0;
			}
		    if(row["File_URL"]!=null && row["File_URL"]!=DBNull.Value)
			{
			    this.FileUrl = (string)row["File_URL"];
			}
			else
			{
				this.FileUrl =string.Empty;
			}
		    if(row["File_Name"]!=null && row["File_Name"]!=DBNull.Value)
			{
			    this.FileName = (string)row["File_Name"];
			}
			else
			{
				this.FileName =string.Empty;
			}
		    if(row["File_Create_Time"]!=null && row["File_Create_Time"]!=DBNull.Value)
			{
			    this.FileCreateTime = (DateTime)row["File_Create_Time"];
			}
			else
			{
				this.FileCreateTime =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["File_ID"] = this.FileId;
			row["File_Length"] = this.FileLength;
			row["File_URL"] = this.FileUrl;
			row["File_Name"] = this.FileName;
			row["File_Create_Time"] = this.FileCreateTime;
		}
		#endregion
	}
}
#endregion
